from marshmallow import fields
from src.baseapp.requestVerify.BaseRequestVerify import BaseSchema


class AddProjectBodySchema(BaseSchema):
    create_user_id = fields.Integer(required=True)
    description = fields.Str(required=False)
    project_name = fields.Str(required=True)


class ProjectListBodySchema(BaseSchema):
    project_id = fields.Integer(required=False)
    project_name = fields.Str(required=False)
    create_user_id = fields.Integer(required=False)
    create_time = fields.DateTime(required=False)
    update_time = fields.DateTime(required=False)


class UpdateProjectBodySchema(AddProjectBodySchema):
    project_id = fields.Integer(required=True)


class ProjectInfoBodySchema(BaseSchema):
    project_id = fields.Integer(required=True)


class AddVersionBodySchema(BaseSchema):
    project_id = fields.Integer(required=True)
    version = fields.Str(required=True)
    description = fields.Str(required=False)
    create_user_id = fields.Integer(required=True)


class UpdateVersionBodySchema(AddVersionBodySchema):
    version_id = fields.Integer(required=True)


class VersionListBodySchema(BaseSchema):
    project_id = fields.Integer(required=False)
    version_id = fields.Integer(required=False)
    version = fields.Str(required=False)
    create_user_id = fields.Integer(required=False)
    create_time = fields.DateTime(required=False)
    update_time = fields.DateTime(required=False)


class VersionInfoBodySchema(BaseSchema):
    version_id = fields.Integer(required=False)

DeleteVersionBodySchema = VersionInfoBodySchema
